/* eslint-disable @typescript-eslint/no-require-imports */
const path = require('path');
const isProduction = process.env.NODE_ENV == 'production';

const config = {
  devtool: false,
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
  },
  plugins: [],
  module: {
    rules: [],
  },
  optimization: {
    usedExports: true,
  },
};

module.exports = () => {
  if (isProduction) {
    config.mode = 'production';
  } else {
    config.mode = 'development';
  }
  return config;
};
